package com.ww.springboot.boot.baseTest.design.factory.simple.factory;

import com.ww.springboot.boot.baseTest.design.factory.simple.Person;
import com.ww.springboot.boot.baseTest.design.factory.simple.impl.Man;
import com.ww.springboot.boot.baseTest.design.factory.simple.impl.Woman;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2022-03-04 11:19
 */
public class PersonFactory {

    public static Person createPerson(String type) {
        Person person = null;
        switch (type) {
            case "man":
                person = new Man();
                break;
            case "woman":
                person = new Woman();
                break;
        }
        return person;
    }
}
